package org.ycy.data.generator;

import cn.hutool.core.io.resource.ResourceUtil;
import lombok.SneakyThrows;
import org.ycy.data.generator.core.SinkFactory;
import org.ycy.data.generator.entity.TemplateConfig;
import org.ycy.data.generator.sink.Sink;
import org.ycy.data.generator.utils.JsonUtil;

/**
 * @ClassName Main
 * @Description 入口启动类
 * @Author 原长友
 * @Date 2023/3/3 23:49
 * @Version 1.0
 **/

public class Main {

    @SneakyThrows
    public static void main(String[] args) {

        String jsonConf = ResourceUtil.readUtf8Str("template.json");
        TemplateConfig templateConfig = JsonUtil.json2Bean(jsonConf, TemplateConfig.class);
        Sink sink = SinkFactory.builderSink(templateConfig);
        sink.process();
    }
}
